package com.webserver.test;

import java.util.*;

public class SortDemo {
    public static void main(String[] args) {
        TreeSet<Object> list = new TreeSet<>();
        list.add(new Emp("tom",22,"男",5000));
        list.add(new Emp("amy",33,"女",5500));
        list.add(new Emp("zom",18,"女",10));
        list.add(new Emp("wahaha",99,"null",9900));
        for(Object e:list){
            System.out.println(e);
        }
        Iterator<Object> iterator = list.iterator();
        while (iterator.hasNext())
            System.out.println(iterator.next());
    }
}
